n = int(input())
max_ans = max_num = 0
for i in range(1, n + 1):
    p = int(input())
    if max_ans < p:
        max_ans = p
        max_num = i
print('%d\n%d'%(max_num, max_ans))